package com.xbongbong.paas.domain.entity;

import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.pro.enums.businessrule.enums.RuleVersionEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2020/5/9 16:31
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class BusinessRuleInfoEntity implements Serializable {
    private static final long serialVersionUID = 7681134436075142599L;

    //========== properties ==========

    /**
     * 主键
     */
    private Long id;

    /**
     * 公司id
     */
    private String corpid;

    /**
     * 当前表单saasMark
     * @see com.xbongbong.pro.enums.SaasMarkEnum
     */
    private Integer saasMark;
    /**
     * 当前表单业务类型
     */
    private Integer businessType;
    /**
     * 当前表单id
     */
    private Long formId;
    /**
     * 当前应用id
     */
    private Long appId;
    /**
     * 当前菜单id
     */
    private Long menuId;

    /**
     * 数据生效时业务规则名称
     */
    private String activeName;

    /**
     * 数据生效时规则类型 1表示简易模式，2表示高级模式
     * @see RuleVersionEnum
     *
     */
    private Integer activeType;

    /**
     * 数据生效时目标表单saas标识
     */
    private Integer activeSaasMark;

    /**
     * 生效时目标表单业务类型
     */
    private Integer activeBusinessType;

    /**
     * 生效时目标表单表单id
     */
    private Long activeFormId;
    /**
     * 生效时目标表单菜单id
     */
    private Long activeMenuId;
    /**
     * 生效时目标表单应用id
     */
    private Long activeAppId;

    /**
     * 数据生效时操作方式
     * @see com.xbongbong.paas.enums.RuleOperationEnum
     */
    private Integer activeOperationType;

    /**
     * 数据生效时 过滤条件
     */
    private String activeFilterConditions;

    /**
     * 数据生效时 前置过滤条件
     */
    private String activePreConditions;

    /**
     * 数据生效时操作
     */
    private String activeOperations;

    /**
     * 数据生效时备注
     */
    private String activeMemo;

    /**
     * 数据生效时是否启用 1： 启用； 否：不启用
     */
    private Integer activeEnable;
    /**
     * 数据失效时业务规则名称
     */
    private String inactiveName;

    /**
     * 数据失效时规则类型 1表示简易模式，2表示高级模式
     *
     */
    private Integer inactiveType;

    /**
     * 数据失效时目标表单saas标识
     */
    private Integer inactiveSaasMark;

    /**
     * 生效时目标表单业务类型
     */
    private Integer inactiveBusinessType;

    /**
     * 生效时目标表单表单id
     */
    private Long inactiveFormId;
    /**
     * 生效时目标表单菜单id
     */
    private Long inactiveMenuId;
    /**
     * 生效时目标表单应用id
     */
    private Long inactiveAppId;

    /**
     * 数据失效时操作方式
     * @see RuleVersionEnum
     */
    private Integer inactiveOperationType;

    /**
     * 数据失效时 过滤条件
     */
    private String inactiveFilterConditions;
    /**
     * 数据失效时 前置过滤条件
     */
    private String inactivePreConditions;
    /**
     * 数据失效时操作
     */
    private String inactiveOperations;

    /**
     * 数据失效时备注
     */
    private String inactiveMemo;

    /**
     * 数据失效时是否启用 1： 启用； 否：不启用
     */
    private Integer inactiveEnable;

    /**
     * 优先级
     */

    private Integer priority;

    /**
     * 创建者userId
     */
    private String creatorId;

    /**
     * 创建时间时间戳
     */
    private Long addTime;

    /**
     * 更新时间时间戳
     */
    private Long updateTime;

    /**
     * 删除标记
     */
    private Integer del;

    public BusinessRuleInfoEntity() {
        this.del = DelEnum.NORMAL.getDel();
    }

    public BusinessRuleInfoEntity(String corpid, Integer saasMark, Integer businessType, Long formId, Long appId, Long menuId, String activeName, Integer activeType, Integer activeSaasMark, Integer activeBusinessType, Long activeFormId, Long activeMenuId, Long activeAppId, Integer activeOperationType, String activePreConditions, String activeFilterConditions, String activeOperations, String activeMemo, Integer activeEnable, String inactiveName, Integer inactiveType, Integer inactiveSaasMark, Integer inactiveBusinessType, Long inactiveFormId, Long inactiveMenuId, Long inactiveAppId, Integer inactiveOperationType, String inactivePreConditions, String inactiveFilterConditions, String inactiveOperations, String inactiveMemo, Integer inactiveEnable, Integer priority, String creatorId, Long addTime, Long updateTime, Integer del) {
        this.corpid = corpid;
        this.saasMark = saasMark;
        this.businessType = businessType;
        this.formId = formId;
        this.appId = appId;
        this.menuId = menuId;
        this.activeName = activeName;
        this.activeType = activeType;
        this.activeSaasMark = activeSaasMark;
        this.activeBusinessType = activeBusinessType;
        this.activeFormId = activeFormId;
        this.activeMenuId = activeMenuId;
        this.activeAppId = activeAppId;
        this.activeOperationType = activeOperationType;
        this.activePreConditions = activePreConditions;
        this.activeFilterConditions = activeFilterConditions;
        this.activeOperations = activeOperations;
        this.activeMemo = activeMemo;
        this.activeEnable = activeEnable;
        this.inactiveName = inactiveName;
        this.inactiveType = inactiveType;
        this.inactiveSaasMark = inactiveSaasMark;
        this.inactiveBusinessType = inactiveBusinessType;
        this.inactiveFormId = inactiveFormId;
        this.inactiveMenuId = inactiveMenuId;
        this.inactiveAppId = inactiveAppId;
        this.inactiveOperationType = inactiveOperationType;
        this.inactivePreConditions = inactivePreConditions;
        this.inactiveFilterConditions = inactiveFilterConditions;
        this.inactiveOperations = inactiveOperations;
        this.inactiveMemo = inactiveMemo;
        this.inactiveEnable = inactiveEnable;
        this.priority = priority;
        this.creatorId = creatorId;
        this.addTime = addTime;
        this.updateTime = updateTime;
        this.del = del;
    }
}
